package com.rem.springboot2.controller;

import com.rem.springboot2.pojo.Car;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 快速开始
 *
 * @author Rem
 * @date 2021-03-18
 */

@RestController
@Slf4j
public class My1HelloController {

    @Autowired
    private Car car;

    @Value("${car.brand}")
    private String brand;

    @GetMapping("hello")
    public String hello() {
        return "hello springboot 2";
    }


    @GetMapping("car")
    public Car car() {
        log.info("请求进来了");
        return car;
    }

    @GetMapping("brand")
    public String brand() {
        return brand;
    }
}
